﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CustomerUI
{
    /// <summary>
    /// Interaction logic for DetailUI.xaml
    /// </summary>
    public partial class DetailUI : Page
    {
        public DetailUI()
        {
            InitializeComponent();
        }
        public static DependencyProperty ContentFrameSourceProperty = DependencyProperty.Register("pagContentFrameSource", typeof(Page), typeof(DetailUI));
        public Page pagContentFrameSource
        {
            get { return (Page)GetValue(ContentFrameSourceProperty); }
            set { SetValue(ContentFrameSourceProperty, value); }
        }
        Button btnPreViewMode;
        void ViewModeHandle(object sender, RoutedEventArgs e)
        {
            var btnSender = sender as Button;
            switch (btnSender.Uid)
            {
                case "Description":
                    pagContentFrameSource = new MovieDescription();
                    break;
                case "Detail":
                    pagContentFrameSource = new MovieDetail();
                    break;
            }
            if (btnPreViewMode != null) btnPreViewMode.IsEnabled = true;
            btnPreViewMode = btnSender;
            btnSender.IsEnabled = false;

        }

        private void Back(object sender, RoutedEventArgs e)
        {
            (App.Current.MainWindow as MainWindow).pagContentFrameSource = MainWindow.pageMainUI;
        }

        private void BookTicket(object sender, RoutedEventArgs e)
        {
            if (Login.Customer.IsLogon)
            {
                blurEffect.Radius = 10;
                (new SelectScheduleType()).ShowDialog();
            }
            else
            {
                blurEffect.Radius = 10;
                MessageBoxUtils.WPFMessageBox.Show((App.Current.FindResource("langBookTicketWhenNotLogin") as String), "", MessageBoxButton.OK);
                blurEffect.Radius = 0;
            }
        }

    }
}
